package demo1;


import org.junit.Before;
import org.junit.Test;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;

public class Test1 {

    @Before
    public void init() throws Exception {
        System.out.println("6666666");
    }

    @Test
    public void test01() throws Exception {
        Class.forName("com.mysql.jdbc.Driver");
        Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306:text01", "root", "123456");
        String sql = "insert into student values (null,?,?,?)";
        PreparedStatement preparedStatement = connection.prepareStatement(sql);
        preparedStatement.setString(1,"llll");
        preparedStatement.setString(2,"郑州");
        preparedStatement.setInt(3,22);
        connection.close();
    }

}
